package books.ThinkingInJava.src.Chapter3;

public class PassObject {
    public static void main(String[] args) {
        //八进制输出测试
//         long f = 01234l;
//        System.out.println(Long.toBinaryString(f));


        //按位操作符测试
        int i = 0xaaaaa;
        int j = 0x55555;
        System.out.println("&  " + Integer.toBinaryString(j & i)); //与
        System.out.println("|  " + Integer.toBinaryString(j | i)); //或
        System.out.println("^  " + Integer.toBinaryString(j ^ i)); //异或
        System.out.println("&=  " + Integer.toBinaryString(j &= i)); //运算并赋值
        System.out.println("|=  " + Integer.toBinaryString(j |= i));
        System.out.println("^=  " + Integer.toBinaryString(j ^= i));
        System.out.println("~  " + Integer.toBinaryString(~i)); //非   因为是四个字节，且数据存于右部分，所以取反数据很多
        System.out.println("~  " + Integer.toBinaryString(~j));
    }
}
